import  React, { Component } from 'react';
import { connect } from 'react-redux';
import { RecommendWarpper,RecommendItem } from '../style';

class Recommend extends Component{
    render(){
        return(
            <RecommendWarpper>
                {
                    this.props.Recommend.map((item)=>{
                        return(
                            <RecommendItem key={item.get("id")} imgUrl={item.get("imgUrl")}></RecommendItem>
                        )
                       
                    })
                }
            </RecommendWarpper>
        )
    }
}

const mapStateToProps=(state)=>{
    return{
        //immutabled对象的get方法
        Recommend:state.getIn(['home','Recommend'])
    }
};

export default connect(mapStateToProps,null)(Recommend)